// import React from 'react'
// @ts-ignore
export const svgDir = require.context("!@svgr/webpack!./svg/");

// export const Icon = svgDir("./close.svg").default

interface ISvgIconProps {
  icon: string;
  size?: string;
  color?: string;
}

export const SvgIcon = (props: ISvgIconProps) => {
  const Icon = svgDir(`./${props.icon}.svg`).default;
  return (
    <Icon
      fill="currentColor"
      height="1em"
      width="1em"
      color={props.color ? props.color : "inherit"}
      fontSize={props.size ? props.size : "inherit"}
    />
  );
};
